import React from "react"
import ChannelStore from "./channels.Store"
import LoginStore from "./login.Store"
import UserStore from "./user.Store"


class RootStore {
  // 组合模块
  constructor() {
    this.loginStore = new LoginStore()
    this.userStore = new UserStore()
    this.channelStore = new ChannelStore()
  }
}
// 实例化
const rootStore = new RootStore()
// 创建context
const context = React.createContext(rootStore)
// useStore方法
const useStore = () => React.useContext(context)
export { useStore }